package net.lateeye.search;

import java.sql.SQLException;

/**
 * (Contradiction of java.sql and suggestion to it)<br />
 * Intrinsically, this exception class should extend/implement a different
 * superclass, but since java.sql has contradiction explained below, this class
 * extends java.sql.SQLException currently (and hopefully temporarily).
 * 
 * Technically, a query for search engine does NOT have to be a subclass of SQL.
 * So an exception that occurs during a communication with search engine does
 * also not have to be a subclass of something that emulates SQL such as
 * SQLException done in this class.
 * 
 * This paradoxical design is rooted in the contradiction that java.sql package
 * has. The description of the package says:
 * 
 * <quote> (http://java.sun.com/javase/6/docs/api/java/sql/package-summary.html)<br />
 * Provides the API for accessing and processing data stored in a data source
 * (usually a relational database) using the JavaTM programming language.
 * </quote>
 * 
 * But all getter methods in ResultSet takes SQLException, for example.
 * 
 * So my opinion, ideally, is:
 * 
 * 1. the package name should something like "java.query"<br />
 * 2. there should be something like "QueryExeption"<br />
 * 
 * @author Isao Isaac Saito <130s@lateeye.net>
 * @since 2.0
 * 
 */
public class SearchEngineQueryException extends SQLException
{
	public static final int ERR_UNKNOWN = 1;
	public static final int ERR_DOCUMENT = 2;
	public static final int ERR_NETWORK = 3;
	public static final int ERR_SEARCH = 4;
	public static final int ERR_SECURITY = 5;

	private int errType = -1;

	public SearchEngineQueryException(int errType, String errMsg)
	{
		super(errMsg);
		this.errType = errType;
	}
}
